package com.stlm2.dems.dao.impl;

import com.stlm2.core.common.page.PageQueryParams;
import com.stlm2.core.common.page.PageView;
import com.stlm2.dems.user.entity.UserState;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.stereotype.Repository;

import com.stlm2.dems.entity.ShopAdminUser;
import com.stlm2.dems.dao.ShopAdminUserDao;
import com.stlm2.core.base.impl.BaseDaoImpl;

import java.util.List;
import java.util.Map;

@Repository("shopAdminUserDao")
public class ShopAdminUserDaoImpl extends BaseDaoImpl<ShopAdminUser> implements ShopAdminUserDao {
    @Override
    public List<ShopAdminUser> getByUserId(int userId) {
        return selectList("getByUserId",userId);
    }

    @Override
    public PageView getByUserShopId(int pageNo, int pageSize, int shopId, int userStateValue,int roleInit) {
        Map<String, Object> params = new HashedMap();
        params.put("shopId",shopId);
        params.put("userStateValue",userStateValue);
        params.put("roleInit",roleInit);
        return  queryPageView(pageNo,pageSize,"getByUserShopId",params);
    }
}